import 'package:get/get.dart';
import '../pages/chat_list_page.dart';
import '../pages/new_chat_page.dart';
import '../pages/search_page.dart';
import '../pages/main_page.dart';
import '../pages/chat_detail_page.dart';

part 'app_routes.dart';

class AppPages {
  static const INITIAL = Routes.MAIN;

  static final routes = [
    GetPage(
      name: Routes.HOME,
      page: () => const ChatListPage(title: '聊天'),
    ),
    GetPage(
      name: Routes.NEW_CHAT,
      page: () => const NewChatPage(),
    ),
    GetPage(
      name: Routes.SEARCH,
      page: () => const SearchPage(),
    ),
    GetPage(
      name: Routes.MAIN,
      page: () => const MainPage(),
    ),
    GetPage(
      name: Routes.CHAT_DETAIL,
      page: () {
        final Map<String, dynamic> args = Get.arguments;
        return ChatDetailPage(
          chatId: args['chatId'],
          title: args['title'],
        );
      },
    ),
  ];
}
